<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

// [js] 写一个数组去重的方法（支持多维数组）
 function name( arr1 = [1,2,3,4,4,5,5,2]) {
  let demo =  [1,2,3,4,4,5,5,2].filter((item,inedx,i)=>{
    console.log(item);
    console.log(inedx);
    console.log(i.indexOf(item) === inedx);
   return  i.indexOf(item) === inedx
   })
   console.log(demo);
 }
//  let arr = [1,2,3,4,4,5,5,2]
 console.log(name());
 console.log([1,2,3,4,4,5,5,2].filter((item, index, arr) => arr.indexOf(item) === index));

 
  function  uniqueArr(params) {
    return [...new Set(params.flat(0))]
  }
  </script>
</body>
</html>